<script>
import store from "@/store/index.js"
import { router } from "@/router"
import { getTicket, globalLocale } from "@/utils/common"
import { getWFLocaleSchools, clockin } from "@/api/mission.js"
import { CoolWPDistance } from "@/utils/base"
// #ifdef H5
import { authReady } from "@/utils/JSAPI_init.ts"
import dd from "gdt-jsapi"
// #endif
// import axios from "axios"
export default {
	onLaunch: function(options) {
		console.log('App Launch', options)
		const token = uni.getStorageSync("token")
		if (token) {
			store.commit("SET_TOKEN", {
				data: token
			})
			store.commit("SET_USERINFO", {
				data: uni.getStorageSync("userInfo") || {}
			})
			getWFLocaleSchools()
				.then((res) => {
					store.commit("SET_WFLSCHOOLS", { data: res })
				})
		}
		
		// #ifdef H5
		
		globalLocale()
		// #endif
		
		uni.getSystemInfo({
			success: function (res) {
				store.commit("SET_OS_NAME", { data: res.osName })
			}
		})
		
		// uni.request({
		// 	url: "https://zhddzs.nbsedu.com/prod-api/app/user/login",
		// 	method: "POST",
		// 	data: {
		// 		username: "testS"
		// 	},
		// 	header: {
		// 		'Content-Type': 'application/json'
		// 	},
		// 	success: (res) => {
		// 		console.log(res)
		// 	}
		// })
	},
	onShow: function(options) {
		console.log('App Show', options)
		// 将获取到的参数传给upload
		store.commit("SET_QUERY", { data: options.query })
	},
	onHide: function() {
		console.log('App Hide')
	}
}
</script>

<style>
/* 每个页面公共css */
@import "assets/css/main.css";
@import "assets/css/icon.css";

page {
	min-height: 100vh;
	/* background-color: #f1f1f1; */
}
</style>
